<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"%>
<%@page import="crm.model.Employees"%>
<%@page import="crm.control.EmployeesControl"%>
<%@page import="crm.control.CustomerControl"%>
<%@page import="crm.model.Schedule"%>
<%@page import="crm.control.ScheduleControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>修改日程</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  
  <body>
  	<%
  		request.setCharacterEncoding("UTF-8");
  		int id = Integer.parseInt(request.getParameter("id"));
  		Schedule schedule = ScheduleControl.getSecheduleInfomation(id);
  	 %>
  	<form action="schedule_update_do.jsp?id=<%=id%>" method="post">
  		<table>
  			<tr><td>创建人姓名</td><td><input type="text" name="creater" value="<%=EmployeesControl.getEmployeesName(schedule.getCreater())%>"/></td></tr>
  			<tr><td>时间</td><td><input type="text" name="create_time" value="<%=schedule.getCreate_time() %>"/></td></tr>
  			<tr><td>主题</td><td><input type="text" name="theme" value="<%=schedule.getTheme() %>"></td></tr>
  			<tr><td>内容</td><td><input type="text" name="content" value="<%=schedule.getContent() %>"></td></tr>
  			<tr><td>状态</td><td align="left"><select name="state" ">
  									<option value="1">开始</option>
                                    <option value="2">进行中</option>
                                    <option value="3">完成</option></select></td></tr>
            <tr><td>关联客户</td><td><select name="related_customer" ">
            							<%  
									    	HashMap customers = CustomerControl.getAllCustomers();
									        Iterator it = customers.entrySet().iterator();
									        while(it.hasNext()){
									    	   Map.Entry entry = (Map.Entry)it.next();
    	  								%>
    	  								<option value="<%=entry.getKey()%>"><%=entry.getValue() %></option>
    	  								<%}%>
            						</select></td></tr>
            <tr><td>关联跟单</td><td><input type="text" name="related_receipt" value="<%=schedule.getRelated_receipt() %>"/>
            						</td></tr>
            <tr><td><input type="submit" value="提交"/></td><td><input type="reset" value="取消" onclick="window.location.href='schedule.jsp'"/></td>
  		</table>
  	</form>
  </body>
</html>
